Skip to content

Conversation

jnoordsij
Copy link
Contributor

As a follow-up to symfony/symfony#60110 which introduces an additional constructor property logger to the RoundRobinTransport class, this PR ensures the app-bound LoggerInterface will be passed when constructing such a class.

Note that this will require Symfony 7.4.0 or higher, which is due for release in November 2025. Given that passing additional parameters to constructors is allowed in PHP (they are just silently ignored), this PR as such is both backwards and forwards compatible, however at current would do effectively nothing. If therefore it is preferable to keep this as draft until (near) the release of Symfony 7.4, that is also perfectly fine with me.

I've already tested to ensure tests still pass with the following composer.json patch:

         "symfony/finder": "^7.2.0",
         "symfony/http-foundation": "^7.2.0",
         "symfony/http-kernel": "^7.2.0",
-        "symfony/mailer": "^7.2.0",
+        "symfony/mailer": "7.4.x-dev as 7.4.0",
         "symfony/mime": "^7.2.0",
         "symfony/polyfill-php83": "^1.31",
         "symfony/process": "^7.2.0",

@jnoordsij jnoordsij marked this pull request as draft July 8, 2025 17:44
@jnoordsij
Copy link
Contributor Author

As static analysis (logically) fails I'll go ahead and keep this in draft until November.

@@ -427,7 +427,7 @@ protected function createRoundrobinTransportOfClass(array $config, string $class
: $this->createSymfonyTransport($config);
}

return new $class($transports, $config['retry_after'] ?? 60);
return new $class($transports, $config['retry_after'] ?? 60, $this->app->make(LoggerInterface::class));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such changes need to be PRed to master branch for the Laravel 13 release?

Laravel 12 still needs to support Symfony 7.3 and lower unless composer.json specifically set to only support 7.4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will still be compatible with older Symfony versions, given that passing additional parameters to a constructor is allowed in PHP (they're just discarded).

So this change is backwards compatible and will only effectively do something for those actually using 7.4+.

@crynobone crynobone added the needs work Not quite ready for primetime label Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs work Not quite ready for primetime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants